/**
 * Created by mill on 2017/11/19.
 */
import React , {Component} from 'react';
import {render} from 'react-dom';

class NotesList extends Component{
   constructor(props) {
    super(props);
    this.state = {isToggleOn: true};

    // 这里需要绑定this，不然后面方法中的this都不能用
    this.handleClick = this.handleClick.bind(this);
  }
    handleClick() {
        console.log(this)
        this.refs.myTextInput.focus();
    }
    render() {
        return (

            <ol>
                {
                    React.Children.map(this.props.children, function (child) {
                        return <li>mill-{child}</li>;
                    })
                }
            </ol>

        );
    }
}
render(

    <NotesList>
        <span>hello1</span>
        <span>world</span>
    </NotesList>,

    document.getElementById('example')
);

